import { GetNewsList, SetPlatformModuleViews, GetBanner } from "~/api";
import { ref, reactive } from "vue";

export const useContent = () => {
    const list = ref([]);
    const bannerList = ref([]);
    const pagination = reactive({
        size: 12,
        page: 1,
    });

    useSeoMeta({
        title: "vr虚拟展厅_AI数字代言人_3d全景展示_3d线上云展编辑平台-北京华锐云空间",
        description:
            "华锐视点云空间，五分钟快速打造行业展会、品牌虚拟展厅、文化展馆及产品3D交互展示等专属营销展示空间，搭配虚拟数字人客服，实现低成本促销获客。电话：13611042909",
        keywords: "虚拟展厅,虚拟人,数字代言人,3d全景展示",
    });

    const GetList = async () => {
        const res = await GetNewsList();
        list.value = res.data;
    };

    const GetBannerList = async (category_id) => {
        const res = await GetBanner({ category_id });
        if (res.code == 200) {
            bannerList.value = res.data;
        }
    };

    SetPlatformModuleViews({ name: "新闻动态" });

    return {
        list,
        pagination,
        bannerList,
        GetList,
        GetBannerList,
    };
};
